<extend name="Public:common"/>
<block name="css">
    <style>
        <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
        .left{width:20%; vertical-align: middle;}
        .right{text-align:left;}
        td{vertical-align: middle;}
        label{margin-left:15px;padding:5px;}
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{vertical-align: middle}
    </style>
</block>
<block name="content">
     <div class="container-fluid">
         <div class="tabbable">
             <div class="row" style="padding:10px;">
                <span style="cursor:pointer;margin-right:10px;" class="btn btn-primary pull-right" onclick="choseOk();">已经选好</span>
             </div>
             <div class="tab-content">
                 <table class="table table-striped table-bordered table-hover table-condensed text-center">
                     <tbody>
                         <volist name="list" id="vo">
                             <tr>
                                 <td class="col-md-2 col-xs-2">
                                     <b>{$vo.supplier_name}({$vo.currency})</b>
                                 </td>
                                 <td class="col-md-10 col-xs-10 text-left">
                                     <volist name="vo['room']" id="ro">
                                     <label for="chk_{$ro.room_priceId}">{$ro.room_name}-{$ro.star_level}星级-房间数{$ro.room_count|default=0}-成人价{$ro.adult_actual_cost}-儿童价{$ro.child_actual_cost}</label>
                                         <input type="checkbox" name="hotel_{$vo.supplier_id}" data-info="{$vo.supplier_name}({$vo.currency})-{$ro.room_name}-{$ro.star_level}星级-房间数{$ro.room_count|default=0}-成人价{$ro.adult_actual_cost}-儿童价{$ro.child_actual_cost}" class="chk" id="chk_{$ro.room_priceId}" value="{$ro.room_priceId}">
                                     </volist>
                                 </td>
                             </tr>
                         </volist>
                     </tbody>
                 </table>
             </div>
         </div>
     </div>
</block>
<block name="js">
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <script>
        function choseOk(){
            var info=[];
             $('.chk').each(function () {
                 if($(this).is(':checked')){
                     var item={id:$(this).val(),'name':$(this).attr('data-info')};
                     info.push(item);
                 }
             });
             if(info.length<=0){
                 layer.msg('请选择酒店');
                 alert('请选择酒店');
                 return false;
             }
            parent.{:I('back')}(JSON.stringify(info));
        }
    </script>
</block>